<?php 
use yii\helpers\Html;
use yii\grid\GridView;
$this->title = '打卡管理';
 ?>
 <div>
    <h1><?= Html::encode($this->title) ?></h1>
    <p>
        <?= Html::a('添加打卡', ['add'], ['class' => 'btn btn-success']) ?>

        <?= Html::a('导出Excel', ['excel'], ['class' => 'btn btn-info']) ?>

    </p>
     <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            // 'id',
            ['label'=>'编号','value' => 'id'],
            [
                'attribute' => '身份',
                'value' => function($model) {
                    return $model->identity == 1 ? '老师' : '学生';
                },
            ],
            ['label'=>'姓名','value' =>  'name'],
            ['label'=>'打卡时间','value' => 'push_time'],
            ['label'=>'打卡人','value' => 'punch'],
            ['label'=>'剩余课时','value' => 'class_time'],
            ['label'=>'创建时间','value' => 'created_at'],
            ['label'=>'更新时间','value' => 'updated_at'],
        ],
    ]);?>
    
 </div>
